home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Archive / Graphics / QuickDraw GX / GX->PostScript Sample / GXToPostScript / Internal Headers / FontDataBase.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  3.0 KB  |  84 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        FontDBase.h
  3.  
  4.      Contains:    QuickDraw GX to PostScript conversion code.
  5.                          File contains data structures and definitions for the font database.
  6.                          
  7.      Version:    Technology:    Quickdraw GX 1.1.x
  8.       
  9.      Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  10. */
  11.  
  12. #ifndef __FONTDBASEHANDLER__
  13. #define __FONTDBASEHANDLER__
  14.  
  15. #include <GXTypes.h>
  16. #include <GXFonts.h>
  17. #include "GXPrintingUniverse.h"
  18.  
  19. enum {
  20.     fdbNoFontFlags                = 0x00000000,
  21.     fdbUseMac8Bit                = 0x00000001,                    /* Indicates that the Mac 8 bit standard encoding should be used for PostScript.*/
  22.     fdbExcludeFontPrereqs        = 0x00000002                    /* Indicates that a font's prerequisits should be excluded from prerequisite list.*/
  23. };
  24. typedef long                             TfdbInfoFlags;
  25. /** Flags may be set by the FontDatabase handler, also may be set by client **/
  26.  
  27. struct fontSfntMap {
  28.     gxFont                             fontID;
  29.     long                             newSfntRsrcID;
  30. };
  31. typedef struct fontSfntMap fontSfntMap;
  32.  
  33.  
  34. /******************* Prototypes ************************/
  35.  
  36. typedef struct privateFontDatabaseCookie* TFontDbase;
  37.  
  38. // Used to build database by client.
  39. OSErr FontDbaseInit(TFontDbase *fontDbase, gxSpoolFile* theFile);
  40. OSErr FontDbaseShutdown(TFontDbase fontDbase, gxSpoolFile* theFile);
  41. OSErr FontDbaseAddPage(TFontDbase fontDbase, gxShape thePage, Boolean useMac8bitEncoding);
  42.  
  43. // Internally used by rest of imaging system.
  44. OSErr FontDbaseAddItem(TFontDbase fontDbase, gxFlatFontListItem *item, Boolean useMac8bitEncoding);
  45. OSErr FontDbaseCountFonts(TFontDbase fontDbase, long *numFonts);
  46. OSErr FontDbaseGetIndexedFont(TFontDbase fontDbase, long index, gxFont *fontID);
  47. OSErr FontDbaseLock(TFontDbase fontDbase);
  48. OSErr FontDbaseUnlock(TFontDbase fontDbase);
  49.  
  50. OSErr FontDbaseGetGlyphBits(
  51.         TFontDbase fontDbase, gxFont fontID, long snapshot,
  52.         unsigned long* *glyphBits, gxFontVariation* *variations);
  53.     
  54. OSErr FontDbaseSpoolFonts(TFontDbase fontDbase, gxSpoolFile* theFile, Boolean justAppFonts, Handle hExclusionList);
  55.     
  56. OSErr FontDbaseSetFontFlags(TFontDbase fontDbase, gxFont fontID, TfdbInfoFlags flags);
  57.     
  58. OSErr FontDbaseGetFontInfo(
  59.         TFontDbase fontDbase, gxFont fontID, long *glyphCount,
  60.         long *axisCount, long *variationCount, TfdbInfoFlags *flags);
  61.  
  62. OSErr FontDbaseBuildPrerequisiteList(
  63.         TFontDbase fontDbase, scalerStreamTypeFlag streamTypes,
  64.         char *productDescription, Boolean useMessages, long *count);
  65.  
  66. OSErr FontDbaseGetIndexedPrerequisite(
  67.         TFontDbase fontDbase, long idx, long *size, gxFont *theFont,
  68.         scalerPrerequisiteItem *item);
  69.  
  70. OSErr FontDbaseExcludePrerequisite(TFontDbase fontDbase, gxFont theFont, Boolean exclude);
  71.  
  72. OSErr FontDbaseAddStyleEntry(
  73.         TFontDbase fontDbase, gxStyle theStyle, long numGlyphs,
  74.         unsigned short glyphs[], Boolean use8BitMacEncoding);
  75.  
  76. OSErr FontDbaseUnion(TFontDbase source, TFontDbase target);
  77.  
  78. OSErr FDBListOfReferencedFONDs( long fontCount, const fontSfntMap fontList[], long* FONDCount, Handle* FONDListPtr);
  79.  
  80. OSErr FDBAddFONDsToResourceFile(long FONDCount, Handle FONDList, gxSpoolFile theFile, Boolean useMessages);
  81.  
  82.  
  83. #endif
  84.